package com.example.javachatroomextend.service;

import com.example.javachatroomextend.mapper.NewFriendMapper;
import com.example.javachatroomextend.model.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NewFriendService {
    @Autowired
    private NewFriendMapper newFriendMapper;

    public Integer addNewFriend(Integer fromId,String fromName,Integer toId) {
        return newFriendMapper.addNewFriend(fromId,fromName,toId);
    }

    public List<Message> getNewFriend(Integer toId) {
        return newFriendMapper.getNewFriend(toId);
    }

    public Integer delete(Integer fromId,Integer toId) {
        return newFriendMapper.delete(fromId,toId);
    }

    public Integer isExist(Integer fromId,Integer toId) {
        return newFriendMapper.isExist(fromId,toId);
    }
}
